<template>
  <div class="dog" @click="$emit('LikeDog', obj.dogName)">
    <img
      src="https://scpic.chinaz.net/files/pic/pic9/202003/zzpic23514.jpg"
      alt=""
    />
    <p @click.stop="btn" :style="{ background: ColorStr }">{{ obj.dogName }}</p>
  </div>
</template>

<script>
export default {
  components: {},
  props: {
    list: Array,
    obj: Object,
  },
  data() {
    return {
      ColorStr: "",
    };
  },
  computed: {},
  watch: {},
  created() {},
  methods: {
    btn() {
      this.ColorStr = `rgb(${Math.floor(Math.random() * 256)},${Math.floor(
        Math.random() * 256
      )}, ${Math.floor(Math.random() * 256)})`;
    },
    ColorNum() {
      return Math.floor(Math.random() * 256);
    },
  },
};
</script>

<style scoped>
.dog {
  float: left;
  width: 200px;
}
img {
  width: 100%;
}
</style>
